package org.merger.domain;



public class Formula {
	private Element firstElement;
	private Element secondElement;
	
	public Formula(Element firstElement, Element secondElement) {
		this.firstElement = firstElement;
		this.secondElement = secondElement;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Formula) return false;
		
		Formula other = (Formula) obj;
		
		//e1 = e'1, e2 = e,2
		if(this.firstElement.equals(other.firstElement)) {
			if(this.secondElement.equals(other.secondElement))
				return true;
			else return false;
		}
		
		//e1 = e'2, e2 = e'1
		if(this.firstElement.equals(other.secondElement)) {
			if(this.secondElement.equals(other.firstElement))
				return true;
			else return false;
		}
		
		return false;
	}
}
